<?php
$consumeAll = \common\models\BusMemberConsume::getConsumeAll(Yii::$app->getRequest()->get('id'));

?>


<?= $this->render('header'); ?>

<div class="container">
	<div class="borB">
		<div class="mg20-y"><span>累计消费：<em class="red">￥<?= strpos($consumeAll, '.') === false ? $consumeAll . '.00' : '0.00' ?></em>元</span></div>
	</div>
	<div class="mt20">
		<?php if(empty($list)){?>
		<table class="table table-bordered">
			<thead>
			<tr>
				<th>日期</th>
				<th>卖价总计</th>
				<th>消费名称</th>
			</tr>
			</thead>
			<tbody>
			<tr>
				<td colspan="3" align="center"><img src="<?=Yii::getAlias('@web/backend/img/nodata.gif');?>"></td>
			</tr>
			</tbody>
		</table>
		<?php }else{?>
		<table class="table table-bordered">
			<thead>
			<tr>
				<th>日期</th>
				<th>卖价总计</th>
				<th>消费名称</th>
			</tr>
			</thead>
			<tbody>

			<?php foreach($list as $consume): ?>
			<tr>
				<td><?= explode(' ', $consume['consume_time'])[0] ?></td>
				<td>￥<?= $consume['consume_amount'] ?></td>
				<td><?= $consume['consume_name'] ?></td>
			</tr>
			<?php endforeach; ?>

			</tbody>
		</table>
		<?php }?>
	</div>


	<div class="page">
		<?= \yii\widgets\LinkPager::widget([
			'pagination' => $page,
			// 'hideOnSinglePage' => true
		]); ?>
	</div>

</div>